#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

//TX3 -- PIN

int main(int a, char *argv[])
{
	char user_buff = argv[0][0];
	
	int fd = open("/dev/gec6818_ptc_drv",O_WRONLY);
	if(fd == -1)
	{
		printf("open error\n");
		return fd;
	}
	//打开文件
	//write(fd,&user_buff,sizeof(user_buff));
	
	#if 1
	//写数据
	while(1)
	{
		
		user_buff = 0; //不叫
		write(fd,&user_buff,sizeof(user_buff));
		
		sleep(3);
		
		
		user_buff = 1;//叫
		write(fd,&user_buff,sizeof(user_buff));
		sleep(3);
	}
	#endif
	
	close(fd);
	
	return 0;
}